package com.hualan.domain;

import lombok.Data;

import java.io.Serializable;

/**
 * FM表，用于存储音频节目信息
 * @TableName fm
 */
@Data
public class Fm implements Serializable {
    /**
     * 编号，主键自增
     */
    private Long id;

    /**
     * 标题
     */
    private String name;

    /**
     * 音乐文件URL
     */
    private String music;

    /**
     * 图片URL
     */
    private String picture;

    private static final long serialVersionUID = 1L;

    public Fm(Long id, String name, String music, String picture) {
        this.id = id;
        this.name = name;
        this.music = music;
        this.picture = picture;
    }

    public Fm(String name, String music, String picture) {
        this.name = name;
        this.music = music;
        this.picture = picture;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Fm other = (Fm) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getMusic() == null ? other.getMusic() == null : this.getMusic().equals(other.getMusic()))
            && (this.getPicture() == null ? other.getPicture() == null : this.getPicture().equals(other.getPicture()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getMusic() == null) ? 0 : getMusic().hashCode());
        result = prime * result + ((getPicture() == null) ? 0 : getPicture().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", music=").append(music);
        sb.append(", picture=").append(picture);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}